package com.nbsaas.boot.marketing.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "积分记录", model = "积分记录")
@Entity
@Table(name = "bs_points_record")
@Comment("积分记录表")
public class PointsRecord extends AbstractEntity {

    @Comment("用户ID")
    @SearchItem(name = "userId", key = "userId", label = "用户ID")
    @FormField(title = "用户ID", sortNum = "1", grid = true, required = true)
    @Column(nullable = false)
    private Long userId;

    @Comment("规则ID")
    @FormField(title = "规则ID", sortNum = "2", grid = true)
    private Long ruleId;

    @Comment("类型")
    @SearchItem(name = "type", key = "type", label = "类型")
    @FormField(title = "类型", sortNum = "3", grid = true, type = InputType.select, option = "points_record_type")
    @Column(length = 20)
    private String type;

    @Comment("积分值")
    @FormField(title = "积分值", sortNum = "4", grid = true, type = InputType.el_input_number)
    private Integer points;

    @Comment("积分余额")
    @FormField(title = "积分余额", sortNum = "5", grid = true, type = InputType.el_input_number)
    private Integer balance;

    @Comment("描述")
    @FormField(title = "描述", sortNum = "6", grid = true)
    @Column(length = 500)
    private String description;

    @Comment("关联订单ID")
    @FormField(title = "关联订单ID", sortNum = "7", grid = true)
    private Long orderId;
} 